package gui.panels;

import gui.containerDate.Nodes;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;

;

public class PanelTree extends JPanel {
	private static JTree jTree1;
	private static PanelTree panelTree = null;
	private DefaultMutableTreeNode top;
	private boolean isSelectable = true;
	private Nodes lastSelect;
	
	public Nodes getLastSelect() {
		return lastSelect;
	}
	public void setLastSelect(Nodes lastSelect) {
		this.lastSelect = lastSelect;
	}
	public boolean isSelectable() {
		return isSelectable;
	}
	public void setSelectable(boolean isSelectable) {
		this.isSelectable = isSelectable;
	}
	private PanelTree() {
		top = new DefaultMutableTreeNode("/");
		top.add(new DefaultMutableTreeNode(Nodes.GROUPS.toString()));
		top.add(new DefaultMutableTreeNode(Nodes.STUDENTS.toString()));
		jTree1 = new JTree(top);
		new JScrollPane(jTree1);
		this.add(jTree1);
	}
	public static PanelTree getInstance(){
		if(panelTree == null){
			panelTree = new PanelTree();
		}
		return panelTree;
	}
	public JTree getJTree() {
		return this.jTree1;
	}
	
	public DefaultMutableTreeNode getMutableTreeNode() {
		return top;
	}
	

}
